//
//  WeaponSearch.h
//  SpaceStorm
//
//  Created by 祥 雍 on 13-7-21.
//  Copyright (c) 2013年 __MyCompanyName__. All rights reserved.
//
//
//  武器的状态机：搜索敌人，锁定敌人，开火

#import "cocos2d.h"
#import "FSMBase.h"


@class WeaponFSMManager;
@class Weapon;
/**
 武器搜寻敌人的状态机
 */
@interface WeaponSearch : FSMBase
{
    WeaponFSMManager* _manager;
}

+(id) searchStateWithManager:(WeaponFSMManager*)manager;
-(id) initStateWithManager:(WeaponFSMManager*)manager;

@property (readwrite, retain) WeaponFSMManager* manager; 
@end



/**
	武器锁定目标的状态机
 */
@interface WeaponLockTarget : FSMBase
{
    WeaponFSMManager* _manager;
}

+(id) lockTargeStateWithManager:(WeaponFSMManager*)manager;
-(id) initStateWithManager:(WeaponFSMManager*)manager;

@property (readwrite, retain) WeaponFSMManager* manager; 

@end

/**
	武器开火的状态机
 */
@interface WeaponFire : FSMBase
{
    WeaponFSMManager* _manager;
}

+(id) fireStateWithManager:(WeaponFSMManager*)manager;
-(id) initStateWithManager:(WeaponFSMManager*)manager;

@property (readwrite, retain) WeaponFSMManager* manager; 
@end

/**
	武器状态机的管理类
 */
@interface WeaponFSMManager: FSMManagerBase
{
    Weapon*                 _weapon;
    WeaponSearch*           _searchState;
    WeaponLockTarget*       _lockTargetState;
    WeaponFire*             _fireState;
}


+(id) managerWithWeapon:(Weapon*)weapon;
-(id) initWithWeapon:(Weapon*)weapon;

-(void) toSearch;
-(void) toLockTarget;
-(void) toFire;

@property (readwrite, retain) Weapon* weapon; 
@property (readwrite, retain) WeaponSearch* searchState; 
@property (readwrite, retain) WeaponLockTarget* lockTargetState; 
@property (readwrite, retain) WeaponFire* fireState; 

@end
